<?php
class UdpPush {
	public  function send($ip, $port ,$data){
		$client = new swoole_client(SWOOLE_SOCK_UDP, SWOOLE_SOCK_SYNC);
		$client->connect($ip, $port);
		$client->send($data);	
	}
}

$server = new swoole_server('0.0.0.0', 6666, SWOOLE_PROCESS, SWOOLE_SOCK_UDP);
$server->listen('0.0.0.0', 15555, SWOOLE_SOCK_UDP);
$server->listen('0.0.0.0', 16666, SWOOLE_SOCK_UDP);
$server->set([
    'worker_num' => 4,
    'daemonize' => 1,
    'max_request' => 10000
]);

$server->on('Packet', function (swoole_server $serv, $data,$addr){
    $client = new UdpPush;
    $client->send('10.62.232.160', 6001, $data);
    print_r($data);
    return true;
});

$server->start();

